package com.mlog.njyjy.ndop.share.zabbix.request;

import com.google.gson.Gson;
import com.mlog.njyjy.ndop.share.zabbix.request.get.AbstractZabbixGetRequest;
import com.mlog.njyjy.ndop.share.zabbix.request.get.AbstractZabbixGetRequestBuilder;
import com.mlog.njyjy.ndop.share.zabbix.response.ZabbixResponse;

import java.util.Map;

/**
 * <p>
 * host.get
 * </p>
 *
 * @author <a href="mailto:yingxiufeng@mlogcn.com">alex</a>
 * @version v1.0, 2020/7/21
 */
public class ZabbixHostGetRequest extends AbstractZabbixGetRequest<ZabbixResponse> {

    private ZabbixHostGetRequest(Builder builder) {
        super(builder);
    }

    @Override
    public String getMethod() {
        return "host.get";
    }

    @Override
    public Map<String, Object> getParams() {
        return getParamsByDefault();
    }

    @Override
    public ZabbixResponse createNewResponse(String responseBody, int statusCode, String reasonPhrase, Gson gson) {
        return createNewResponse(new ZabbixResponse(gson), responseBody, statusCode, reasonPhrase);
    }

    public static class Builder extends AbstractZabbixGetRequestBuilder<ZabbixHostGetRequest, Builder> {

        /**
         * build request
         *
         * @return
         */
        @Override
        public ZabbixHostGetRequest build() {
            return new ZabbixHostGetRequest(this);
        }
    }
}
